package org.acra.sender;

import android.net.Uri;
import android.util.Log;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.d.h;
import org.json.JSONObject;

public class HttpSender
  implements d
{
  private final Uri a;
  private final Map b;
  private final HttpSender.Method c;
  private final HttpSender.Type d;

  public HttpSender(HttpSender.Method paramMethod, HttpSender.Type paramType, Map paramMap)
  {
    this.c = paramMethod;
    this.a = null;
    this.b = paramMap;
    this.d = paramType;
  }

  private Map a(Map paramMap)
  {
    ReportField[] arrayOfReportField = ACRA.getConfig().d();
    if (arrayOfReportField.length == 0)
      arrayOfReportField = org.acra.e.c;
    HashMap localHashMap = new HashMap(paramMap.size());
    int i = arrayOfReportField.length;
    int j = 0;
    if (j < i)
    {
      ReportField localReportField = arrayOfReportField[j];
      if ((this.b == null) || (this.b.get(localReportField) == null))
        localHashMap.put(localReportField.toString(), paramMap.get(localReportField));
      while (true)
      {
        j++;
        break;
        localHashMap.put(this.b.get(localReportField), paramMap.get(localReportField));
      }
    }
    return localHashMap;
  }

  public void a(org.acra.b.c paramc)
  {
    Object localObject;
    org.acra.d.c localc;
    while (true)
    {
      try
      {
        if (this.a == null)
        {
          localObject = new URL(ACRA.getConfig().j());
          Log.d(ACRA.LOG_TAG, "Connect to " + ((URL)localObject).toString());
          if (!org.acra.c.a(ACRA.getConfig().k()))
            break label326;
          str1 = null;
          boolean bool = org.acra.c.a(ACRA.getConfig().l());
          str2 = null;
          if (!bool)
            break label337;
          localc = new org.acra.d.c();
          localc.a(ACRA.getConfig().c());
          localc.b(ACRA.getConfig().E());
          localc.c(ACRA.getConfig().p());
          localc.a(str1);
          localc.b(str2);
          switch (HttpSender.1.$SwitchMap$org$acra$sender$HttpSender$Method[this.c.ordinal()])
          {
          default:
            throw new UnsupportedOperationException("Unknown method: " + this.c.name());
          case 1:
          case 2:
          }
        }
      }
      catch (IOException localIOException)
      {
        throw new e("Error while sending " + ACRA.getConfig().O() + " report via Http " + this.c.name(), localIOException);
        localObject = new URL(this.a.toString());
        continue;
      }
      catch (h localh)
      {
        throw new e("Error while sending " + ACRA.getConfig().O() + " report via Http " + this.c.name(), localh);
      }
      label326: String str1 = ACRA.getConfig().k();
      continue;
      label337: String str2 = ACRA.getConfig().l();
    }
    String str3 = org.acra.d.c.a(a(paramc));
    while (true)
    {
      localc.a((URL)localObject, this.c, str3, this.d);
      return;
      str3 = paramc.a().toString();
      URL localURL = new URL(((URL)localObject).toString() + '/' + paramc.a(ReportField.REPORT_ID));
      localObject = localURL;
    }
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     org.acra.sender.HttpSender
 * JD-Core Version:    0.6.2
 */